import Vue from 'vue'
import App from './App'
// 关闭生产校验
Vue.config.productionTip = false

// 完整引入elementUI
// import ElementUI from 'element-ui';
// import 'element-ui/lib/theme-chalk/index.css';
// Vue.use(ElementUI)

// 按需引入ElementUI组件
import {
  Loading, MessageBox, Notification, Message,
  Tabs, TabPane,
  Menu, Submenu, MenuItem, MenuItemGroup,
  Row, Col, 
  Form, FormItem, ColorPicker, Button,
  Input, InputNumber, Radio, RadioGroup, RadioButton,
  Checkbox, CheckboxButton, CheckboxGroup,
  Switch, Select, Option, OptionGroup, ButtonGroup,
  DatePicker, TimeSelect, TimePicker,
  Table, TableColumn,
} from  'element-ui'
Vue.use(Tabs)
Vue.use(TabPane)
Vue.use(Menu)
Vue.use(Submenu)
Vue.use(MenuItem)
Vue.use(MenuItemGroup)
Vue.use(Row)
Vue.use(Col)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(ColorPicker)
Vue.use(Button)
Vue.use(Input)
Vue.use(InputNumber)
Vue.use(Radio)
Vue.use(RadioGroup)
Vue.use(RadioButton)
Vue.use(Checkbox)
Vue.use(CheckboxButton)
Vue.use(CheckboxGroup)
Vue.use(Switch)
Vue.use(Option)
Vue.use(OptionGroup)
Vue.use(ButtonGroup)
Vue.use(DatePicker)
Vue.use(TimeSelect)
Vue.use(TimePicker)
Vue.use(Select)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Loading.directive)
Vue.prototype.$loading = Loading.service;
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
Vue.prototype.$confirm = MessageBox.confirm;
Vue.prototype.$prompt = MessageBox.prompt;
Vue.prototype.$notify = Notification;
Vue.prototype.$message = Message;

// 引入自定义插件
import plugins from './plugins'
Vue.use(plugins)

// 引入定义的Vuex的store
import store from './store'

// 引入VueRouter及自定义路由器
import VueRouter from 'vue-router';
Vue.use(VueRouter)
import router from './router'
// Vue.prototype.$router = router

// axios
import axios from 'axios'
//配置后端的访问地址（axios.defaults.baseURL的配置，如果配置了，vue.config.js文件中配置的devServer代理会失效。不建议配置）
// axios.defaults.baseURL = process.env.VUE_APP_API
axios.defaults.headers.post['Content-Type']='application/x-www-form-urlencoded;charset=utf-8'
Vue.prototype.$axios = axios

// 自定义工具类
import utils from '@/assets/js/utils'
Vue.prototype.$utils = utils

//需要走代理服务的前缀
Vue.prototype.$proxy=process.env.VUE_APP_PROXY_PREFIX

new Vue({
  render: h => h(App),
  store,
  router: router,
  beforeCreate() {
    // 注册全局消息总线
    Vue.prototype.$bus = this
  }
}).$mount('#app')
